<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     <title>值班</title>
</head>
<span id="clock"><span> 
 <body>
<script type="text/javascript">
  
	function clock()
	{
    var time=new Date();
  	var year=time.getFullYear();
	var month=time.getMonth();
	var date=time.getDate();
	var se =time.getSeconds();
	var week;
    var db;
    var n;
    var k;
	var next;
	
	switch (time.getDay())
		{
							case 1: week="周一"+"<br>"+"制作运维：沈玥婷 电话：666570"; k=1;break;
							case 2: week="周二"+"<br>"+"制作运维：杨辰 电话：660162"; k=2;break;
							case 3: week="周三"+"<br>"+"制作运维：沈玥婷 电话：666570"; k=3;break;
							case 4: week="周四"+"<br>"+"制作运维：周冰杰 电话：663326"; k=4;break;
							case 5: week="周五";k=5;
													if(time.getHours() >= 0 && time.getHours() <=16 )week="周五"+"<br>"+"上午班，制作运维：杨辰 电话：660162"; 
													else   week="周五"+"<br>"+"下午班，制作运维：周冰杰 电话：663326";break;
							case 6: week="周六1";k=6;
													if(time.getHours() >= 0 && time.getHours() <=16 )week="周六"+"<br>"+"上午班，制作运维：周冰杰 电话：663326"; 
													else   week="周六"+"<br>"+"下午班，制作运维：杨辰 电话：660162";break;	
							default: week="周日";k=0;n=cn(7);db=on_duty7(n);
		}

	
	function fun_date(aa)
		{
		var date1 = new Date(),
			time1=date1.getFullYear()+"-"+(date1.getMonth()+1)+"-"+date1.getDate();
		var date2 = new Date(date1);
			date2.setDate(date1.getDate()+aa);
		var time2 = date2.getFullYear()+"-"+(date2.getMonth()+1)+"-"+date2.getDate();
		return time2;
		}
	
	
	function on_duty7(bb)
		{
		if(bb==0) db="周冰杰 电话：663326";
		else if (bb==2) db="沈玥婷 电话：666570";
			else db="杨辰 电话：660162";
		return db
		}
  
	function next_duty7(cc)
		{
		if(cc==0) next="杨辰 电话：660162";
		else if (cc==2)next="周冰杰 电话：663326";
			else next="沈玥婷 电话：666570";
		return next
		}
  
	function cn(dd)
		{
  
		var date1=new Date(2020,9,4,0,0,0); 
		var date2=new Date(); 
		var date3=date2.getTime()-date1.getTime();
		var days=Math.floor(date3/(24*3600*1000));
		var js=(days-dd+7)/7
		var n1=js%3
		return n1
		}
	
	if(k==0)
		{
		document.getElementById("clock").innerHTML = "今天是："+year+"年"+(month+1)+"月"+date+"日  "+time.getHours()+":" +time.getMinutes()+":"+time.getSeconds()+" "+week + "<br>"+db+" "+"<br>"+"本周日："+fun_date(0)+on_duty7(n)+"<br>"+"下周日："+fun_date(7)+" "+next_duty7(n);
		document.getElementById("footyear").innerHTML = year;}
	else{ 
		document.getElementById("clock").innerHTML = "今天是："+year+"年"+(month+1)+"月"+date+"日  "+time.getHours()+":" +time.getMinutes()+":"+time.getSeconds()+" "+week+"<br>"+" "+"本周日："+fun_date(7-k)+on_duty7(cn(k))+"<br>"+"下周日："+fun_date(14-k)+" "+next_duty7(cn(k))+"<br>"+"版本1.0.2";
		document.getElementById("footyear").innerHTML = year;}
		}
  setInterval(clock,1000); 
</script>
 </body>
</html>